Skip to content

test(signals): cover decidePublicSurface's oss_maintainer + not_checked willLabel fallback (#8324) - #8485

Closed
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:test-settings-preview-oss-maintainer-not-checked-8324
Closed

test(signals): cover decidePublicSurface's oss_maintainer + not_checked willLabel fallback (#8324)#8485
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:test-settings-preview-oss-maintainer-not-checked-8324

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Summary

  • decidePublicSurface's willLabel computation (src/signals/settings-preview.ts:147-149) has an inline fallback disjunct for publicAudienceMode: "oss_maintainer" + minerStatus: "not_checked" that had zero test coverage — grep -n "not_checked" test/unit/settings-preview.test.ts returned no matches before this PR.
  • Adds four tests covering every combination of autoLabelEnabled and publicSurface for this branch: labels when comment_and_label or label_only with autoLabelEnabled: true, does NOT label for comment_only (excluded by the disjunct's own publicSurface check) or when autoLabelEnabled: false.
  • shouldApplyPrLabel itself always returns false for oss_maintainer + any non-"confirmed" status (including "not_checked"), confirmed by reading its source — so willLabel: true in these new tests is exercising exclusively the inline fallback disjunct, not double-satisfied by the imported function. Pure test-addition; no production code in settings-preview.ts was changed, per the issue's explicit scope.

Closes #8324

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • This PR only touches test/unit/settings-preview.test.ts (test-only, no src/ production-code change) — no UI/MCP/workers/OpenAPI surface is affected. Verified via npx vitest run test/unit/settings-preview.test.ts: all 36 tests pass, including the 4 new ones. Coverage on the changed condition (verified directly against coverage/lcov.info): the willLabel computation's line shows all 6 tracked branch points hit (BRDA:148,21,0,37 through BRDA:148,21,5,2 — every count non-zero), confirming full branch coverage across the whole ||/&& chain including the previously-uncovered not_checked fallback.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/session/CORS changes.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP surface changed.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots. (N/A — no visible UI changes.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A.)

Notes

  • No divergence from shouldApplyPrLabel's intent was found while writing these tests — the fallback disjunct behaves exactly as its own inline logic states, so there's nothing to flag for maintainer triage beyond the new coverage itself.

…ed willLabel fallback (JSONbored#8324)

The inline fallback disjunct in willLabel's computation (settings.publicAudienceMode
=== "oss_maintainer" && input.minerStatus === "not_checked" && settings.autoLabelEnabled
&& (comment_and_label || label_only)) had zero test coverage despite decidePublicSurface's
own doc comment claiming it's the single source of truth shared by the live webhook
processor and the maintainer-facing dry-run preview. Adds four tests covering every
combination of autoLabelEnabled and publicSurface for this branch: labels for
comment_and_label and label_only, does not label for comment_only or when
autoLabelEnabled is false. shouldApplyPrLabel itself always returns false for
oss_maintainer + any non-confirmed status, so willLabel: true in these tests is
exclusively exercising the inline fallback, not double-satisfied by the imported
function. Pure test-addition, no production code changed.
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 24, 2026 15:09
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-24 15:27:32 UTC

1 file · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a pure test-addition PR closing #8324, adding four unit tests to cover decidePublicSurface's inline fallback disjunct for oss_maintainer + not_checked, a branch previously untested. The tests correctly isolate the fallback logic from shouldApplyPrLabel (which always returns false for non-confirmed status), and the four cases cover the two truthy publicSurface values, the excluded comment_only case, and the autoLabelEnabled:false case. No production code is touched, matching the PR's stated scope.

Nits — 4 non-blocking
  • The new describe block tests publicSurface values comment_and_label and label_only but doesn't explicitly assert the disjunct's actual condition shape (e.g. via a fifth case flipping publicAudienceMode away from oss_maintainer) to prove the fallback is truly audience-gated, though this is arguably redundant given the existing top-level test suite already covers other audience modes.
  • The inline comment in test/unit/settings-preview.test.ts:86-88 duplicates reasoning already given in the PR description verbatim; consider trimming it to a one-liner since the test names already convey the same intent.
  • Consider adding one more case with publicAudienceMode set to something other than oss_maintainer (e.g. gittensor_only) plus minerStatus not_checked to explicitly confirm the fallback disjunct is scoped to oss_maintainer only, since that's an implicit assumption the tests rely on but don't directly verify.
  • The two FAILED CI checks (validate, validate-tests-merge) are undetailed and this branch is 2 commits behind default — worth rebasing before merge to rule out stale-branch causes rather than a defect in this diff.

CI checks failing

  • validate
  • validate-tests-merge

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8324
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1040 registered-repo PR(s), 615 merged, 126 issue(s).
Contributor context ✅ Confirmed Gittensor contributor philluiz2323; Gittensor profile; 1040 PR(s), 126 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds exactly the four test cases the issue requested for the oss_maintainer + not_checked willLabel fallback, covering both true-producing publicSurface variants, the excluded comment_only case, and the autoLabelEnabled:false case, without modifying production code as instructed.

Review context
  • Author: philluiz2323
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, TypeScript, CSS, Cuda, HTML, Kotlin
  • Official Gittensor activity: 1040 PR(s), 126 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test coverage for decidePublicSurface's oss_maintainer + not_checked auto-label fallback

1 participant